package com.zhentao.comtroller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zhentao.pojo.Orders;
import com.zhentao.service.OrdersService;
import com.zhentao.vo.OrderQuery;
import com.zhentao.vo.Result;
import org.aspectj.weaver.ast.Or;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("order")
public class OrderController {
    @Autowired
    private OrdersService ordersService;
    @RequestMapping("find")
    public Result find(@RequestBody OrderQuery orderQuery){
        QueryWrapper<OrderQuery> orderQueryQueryWrapper = new QueryWrapper<>();
//        状态
        if (orderQuery.getStatus()!=null){
            orderQueryQueryWrapper.eq("status",orderQuery.getStatus());
        }
//        订单号
        if (orderQuery.getSjbh()!=null){
            orderQueryQueryWrapper.eq("sjbh",orderQuery.getSjbh());
        }
//        ordersService.page()
        return Result.OK();
    }
}
